import { _decorator, Component, director, instantiate, Node, Prefab, resources, Scene, Sprite, SpriteFrame } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('SwitchScene')
export class SwitchScene extends Component {
    @property({type: Node})
    private GameScene_Classic: Node | null = null;
    @property({type: Node})
    private GameScene_Dig: Node | null = null;
    @property({type: Scene})
    private MenuScene: Scene | null = null;

    start() {
    }

    update(deltaTime: number) {
        this.preLoadRes();
    }

    //预加载资源以减少跳转延迟
    preLoadRes() {
        // resources.loadScene("GameScene_Classic");
        // resources.loadScene("GameScene_Dig");
    }
    //经典模式
    classicModeBtnClick() {
        director.loadScene("GameScene_Classic");
    }
    //矿工模式
    digModeBtnClick() {
        director.loadScene("GameScene_Dig");
    }    
}


